package com.haixiaoke.saas.apartment.service.impl;

import java.util.List;

import com.haixiaoke.saas.common.utils.DateUtils;
import com.haixiaoke.saas.apartment.domain.Require;
import com.haixiaoke.saas.apartment.mapper.RequireMapper;
import com.haixiaoke.saas.apartment.service.IRequireService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 房间要求种类Service业务层处理
 * 
 * @author panda
 * @date 2024-03-21
 */
@Service
public class RequireServiceImpl implements IRequireService {
    @Autowired
    private RequireMapper requireMapper;

    /**
     * 查询房间要求种类
     * 
     * @param requireId 房间要求种类主键
     * @return 房间要求种类
     */
    @Override
    public Require selectRequireByRequireId(Long requireId) {
        return requireMapper.selectRequireByRequireId(requireId);
    }

    /**
     * 查询房间要求种类列表
     * 
     * @param require 房间要求种类
     * @return 房间要求种类
     */
    @Override
    public List<Require> selectRequireList(Require require) {
        return requireMapper.selectRequireList(require);
    }

    /**
     * 新增房间要求种类
     * 
     * @param require 房间要求种类
     * @return 结果
     */
    @Override
    public int insertRequire(Require require) {
        require.setCreateTime(DateUtils.getNowDate());
        return requireMapper.insertRequire(require);
    }

    /**
     * 修改房间要求种类
     * 
     * @param require 房间要求种类
     * @return 结果
     */
    @Override
    public int updateRequire(Require require) {
        require.setUpdateTime(DateUtils.getNowDate());
        return requireMapper.updateRequire(require);
    }

    /**
     * 批量删除房间要求种类
     * 
     * @param requireIds 需要删除的房间要求种类主键
     * @return 结果
     */
    @Override
    public int deleteRequireByRequireIds(Long[] requireIds) {
        return requireMapper.deleteRequireByRequireIds(requireIds);
    }

    /**
     * 删除房间要求种类信息
     * 
     * @param requireId 房间要求种类主键
     * @return 结果
     */
    @Override
    public int deleteRequireByRequireId(Long requireId) {
        return requireMapper.deleteRequireByRequireId(requireId);
    }
}
